package com.mifengkong.frtools.jsbridge.webview;


import android.webkit.WebView;

import com.mifengkong.frtools.jsbridge.BridgeWebView;
import com.mifengkong.frtools.jsbridge.BridgeWebViewClient;


/**
 * Class description
 *
 * @author YEZHENNAN220
 * @date 2016-07-08 13:54
 */
public abstract class CustomWebViewClient extends BridgeWebViewClient {

    public CustomWebViewClient(BridgeWebView webView) {
        super(webView);
    }

    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        return super.shouldOverrideUrlLoading(view, url);
    }

    @Override
    public void onPageFinished(WebView view, String url) {
        super.onPageFinished(view, url);
    }

    @Override
    public void onReceivedError(WebView view, int errorCode,
                                String description, String failingUrl) {
        view.loadUrl(onPageError(failingUrl));
    }

    /**
     * return errorUrl
     * @param url
     * @return
     */
    public abstract String onPageError(String url);


}
